/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.service;

import cn.hutool.poi.excel.ExcelWriter;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.model.Form;
import com.yami.shop.bean.model.FormItem;
import com.yami.shop.common.util.PageParam;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 *
 * @author lgh on 2018/11/26.
 */
public interface FormService extends IService<Form> {

    /**
     * 获取所有的表格选择指标的枚举对象
     * @param type 1:平台端  2：商家端
     * @return
     */
    List<FormItem> getFormItem(Integer type);

    void formExcel(Long formId, HttpServletResponse response);

    /**
     * 报表项的数据
     * @param writer
     * @param firstRow
     * @param lastRow
     * @param firstColumn
     * @param lastColumn
     * @param content
     */
    void mergeIfNeed(ExcelWriter writer, int firstRow, int lastRow, int firstColumn, int lastColumn, Object content);

    /**
     * 返回报表的数据
     * @param response
     * @param writer
     */
    void writeExcel(HttpServletResponse response, ExcelWriter writer);

    /**
     * 获取推荐报表列表
     * @return
     */
    List<Form> getRecommendFormList();

    /**
     * 清除推荐报表列表的缓存信息
     */
    void removeCache();

    /**
     * 分页获取推荐报表
     * @param page
     * @param form
     * @return
     */
    IPage<Form> getRecommendFormPage(PageParam<Form> page, Form form);
}
